You can use a language properties file to test your application on a different language. In this way, the same test script originally prepared to test an application in one language can be utilized to test it in any number of other languages.
This is done by using the SetLanguagePropertiesFile which specify which properties file to use.
You can either create the properties file manually or generate it automatically.
To extract all of the language properties files packaged with an application automatically:
Step 1: Preparing Applications For Testing.
Step 2: Right-click the name of the application from which you want to extract the language files.
Step 3: Select the Import Language Files option
Step 4: In the dialog box now displayed, navigate to the location to which the files are to be extracted.
Step 5: Click OK.
A languages properties file is a text properties file (ends with the suffix .properties) which maps a key and the identifier of the element. On you script you will use the key to identify the element. You can use the same key for all languages file and this way the same script will run for any language.
For example, the following lines represent a portion of the English language properties file for a certain banking application:
automatic_alerts_text=General Alerts
delete_pay_to=Delete Pay To
show_hidden_deals=Show hidden deals
accounts_heloc_footnote=1This payment amount may reflect the minimum amount due from your last statement period. View your statement for more details.
mrd_check_photo_status=Received
p2p_added_recipient_message=The recipient has been added, and you can now request a transfer.
A Spanish language version of this same application might begin something like what appears below:
automatic_alerts_text=Alertas Generales
delete_pay_to=Eliminar la Paga a
In order to operate on the first element appears on the file, we will create a command on the script with the identifier as key - delete_pay_to
In order to run the application on each language we need to make sure to change the SetLanguagePropertiesFile accordingly.
Following are the properties that you can use in the text properties file:
text
partial_text
placeholder
accessibilitylabel
accessibilityidentifier
accessibilityvalue
name
xpath